/*
 * @Description: 
 * @Author: Jimmy
 * @Date: 2023-07-21 22:44:24
 * @LastEditTime: 2023-07-25 20:21:15
 * @LastEditors:  
 */
import KoaRouter from 'koa-router'
const router = new KoaRouter({ prefix: '/sys/user' });
import userController from '../controller/user.controller'
import { cryptPassword, verifyUser } from '../middleware/system.middleware';
import { baseUserValidator } from '../middleware/user.middleware';
import { auth, hadAdminPermission } from '../middleware/auth.middleware';
import { verifyPageSize } from '../middleware/pagesize.middleware';

router.use(auth)
router.use(hadAdminPermission)
//创建用户信息
router.post('/create', baseUserValidator,verifyUser, cryptPassword, userController.createUserInfo)
//批量上传
router.post('/upload', userController.dealGroupUser)
//删除用户信息
router.delete('/delete',userController.deleteUserInfo)
//更新用户信息
router.put('/update',userController.updateUserInfo)
//查询用户信息
router.get('/query',userController.getUserInfo)
//查询用户列表
router.get('/queryList',verifyPageSize,userController.queryList)

export default router